Skip to content

Conversation

mihaigalos
Copy link

Summary:

This PR mitigates runtime operator fights between mutators of the Pods generated by the MongoDB StatefulSet and the MongoDB Community Operator.

It preserves previous labels instead of hard-coding them. The previous logic of adding the app label is kept as-is. The MongoDB operator can still overwrite labels it wants to have in a specific form.

All Submissions:

Closes: mongodb/mongodb-kubernetes-operator#1732.

// WithPodLabels merges the provided labels with existing PodTemplateSpec labels.
// This preserves labels added by external systems (like Kyverno policies) while
// allowing the operator to add or override its own labels.
func WithPodLabels(labels map[string]string) Modification {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you have removed WithInitContainerByIndex but it is still used in the codebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Operator fight with Kyverno: Labels on Pods
2 participants